package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Comment;
import com.cskaoyan.bean.CommentVO;
import com.cskaoyan.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WeitenHong
 * @date 2020/10/2 14:11
 */

@RestController
@RequestMapping("admin")
public class GoodsCommentController {

    @Autowired
    GoodService goodService;

    @RequestMapping("/comment/list")
    public BaseRespVo commentList(Integer page,Integer limit,Integer userId,Integer valueId,String sort,String order){
        CommentVO commentVO=goodService.commentList(page,limit,userId,valueId,sort,order);
        return BaseRespVo.ok(commentVO);
    }

    @RequestMapping("/comment/delete")
    public BaseRespVo delete(@RequestBody Comment comment){
        goodService.deleteComment(comment);
        return BaseRespVo.ok();
    }

    @RequestMapping("/oder/reply")
    public BaseRespVo reply(Integer commentId,String content){
//        int code=goodService.reply(commentId,content);
//        if(code==200){
//            return BaseRespVo.ok("回复成功");
//        }
        return BaseRespVo.ok();
    }



}
